import React from 'react'
import "./index.less"
export default function Model(props: any) {
    // 标题  内容
    // 开关 完成回调 取消回调
    const { isOpen, success, cancel, title } = props;
    return (
        <>
            {
                isOpen ?
                    <div className="model">
                        <h5>{title}</h5>
                        <div className="model_box">
                            {props.children}
                            <div className="model_footer">
                                <button onClick={() => {
                                    cancel()
                                }}>取消</button>
                                <button onClick={success}>确认</button>
                            </div>
                        </div>
                    </div> :
                    <></>
            }
        </>

    )
}
